package com.aidong.dynamic.biz.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.aidong.dynamic.biz.TrnDynamicMessageBiz;
import com.aidong.dynamic.dao.TrnDynamicMessageDao;
import com.aidong.dynamic.entity.TrnMessageCount;

@Service("trnDynamicMessageBiz")
public class TrnDynamicMessageBizImpl implements TrnDynamicMessageBiz {

	private TrnDynamicMessageDao messageDao;

	@Autowired
	public void setMessageDao(TrnDynamicMessageDao messageDao) {
		this.messageDao = messageDao;
	}

	/**
	 * 运动圈消息列表
	 */
	@Override
	public List<Map<String, Object>> getMessagePush(Map<String, Object> map) {
		Map<String, Object> paraMap = new HashMap<String, Object>();
		paraMap.put("idongId", map.get("idongId"));
		messageDao.editMessageStatus(paraMap);
		return messageDao.getMessagePush(map);
	}

	/**
	 * 消息列表单条删除
	 * 
	 * @param map
	 */
	@Override
	public void delMessageListOne(Map<String, Object> map) {
		messageDao.delMessageListOne(map);
	}

	/**
	 * 消息列表清空
	 * 
	 * @param map
	 */
	@Override
	public void delMessageListAll(Map<String, Object> map) {
		messageDao.delMessageListAll(map);
	}

	/**
	 * 消息列表数量提醒
	 * 
	 * @param map
	 * @return
	 */
	@Override
	public TrnMessageCount getMessageCount(Map<String, Object> map) {
		return messageDao.getMessageCount(map);
	}

	/**
	 * 运动圈消息查看状态改变
	 * 
	 * @param map
	 */
	@Override
	public void editMessageStatus(Map<String, Object> map) {
		messageDao.editMessageStatus(map);
	}

	/**
	 * 未读消息列表
	 * 
	 * @param map
	 * @return
	 */
	@Override
	public List<Map<String, Object>> getUnreadMessages(Map<String, Object> map) {
		return messageDao.getUnreadMessages(map);
	}

	/**
	 * 已读消息列表
	 * 
	 * @param map
	 * @return
	 */
	@Override
	public List<Map<String, Object>> getreadMessages(Map<String, Object> map) {
		return messageDao.getreadMessages(map);
	}

	/**
	 * 动态是否存在
	 * 
	 * @param map
	 * @return
	 */
	@Override
	public int getDynamicExit(Map<String, Object> map) {
		return messageDao.getDynamicExit(map);
	}

	/**
	 * 评论是否存在
	 * 
	 * @param map
	 * @return
	 */
	@Override
	public int getCommentExit(Map<String, Object> map) {
		return messageDao.getCommentExit(map);
	}
}
